/*
 * Created by: Ahmedzhanov Nail,400,438534,,J2EE
 * Created: Monday, December 25, 2006
 */

using System;
using Dune.Business.Domain.Users;
using Dune.DAL.Common.Interceptors;
using Edge.DAL.Managers;

namespace Dune.DAL.Managers.Users
{
    public class UserInterceptor : BaseManager, ILifeCircleInterceptor
    {
        public void BeforeSave(object obj)
        {
            User contact = (User)obj;
            // TODO move this code to interceptor !
            if (IsNewObject(obj))
            {
                contact.CreateDate = DateTime.Now;
                //contact.ModifyDate = DateTime.Now;
            }
            else
            {
                //contact.ModifyDate = DateTime.Now;
            }
        }
    }
}